﻿using System;
using System.Reflection;

namespace AnB.Common
{
    public static class App
    {
        public static string Path
        {
            get
            {
                var assembly = Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly();
                return assembly.Location;
            }
        }

        public static string Dir
        {
            get
            {
                return System.IO.Path.GetDirectoryName(Path);
            }
        }

        public static string ConfigPath
        {
            get
            {
                return System.IO.Path.Combine(Dir, "Config");
            }
        }
        public static string Config(string filename)
        {
            return System.IO.Path.Combine(ConfigPath, filename);
        }
    }
}
